Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-cookie

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-cookie

A simple, lightweight JavaScript API for handling cookies

  • 3.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.1M
decreased by-16.4%
Maintainers
2
Weekly downloads
 
Created

What is js-cookie?

The js-cookie package is a simple, lightweight JavaScript API for handling cookies. It allows you to create, read, and delete cookies with ease. It's designed to be straightforward and easy to use, making it a popular choice for web developers looking to manage cookies in their web applications.

What are js-cookie's main functionalities?

Create a cookie

This feature allows you to create a new cookie. The first parameter is the name of the cookie, and the second parameter is the value of the cookie.

Cookies.set('name', 'value');

Read a cookie

This feature enables you to read the value of a cookie. You pass the name of the cookie you want to read as the parameter.

Cookies.get('name');

Delete a cookie

This feature allows you to delete a cookie. You simply pass the name of the cookie you wish to delete as the parameter.

Cookies.remove('name');

Set cookie with expiration

This feature lets you create a cookie that expires. The third parameter is an options object where you can set the expiration of the cookie in days.

Cookies.set('name', 'value', { expires: 7 });

Other packages similar to js-cookie

Keywords

FAQs

Package last updated on 24 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc